package experiment;

/**
 * @ClassName ArrayListToStream
 * @Date 2024/11/26 10:51 43
 * @Author Jack Chen
 * @Description serenity-cucumber-auto-project-jack
 * @Version 1.0
 */

import java.util.ArrayList;
import java.util.stream.Stream;

public class ArrayListToStream {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("Element1");
        arrayList.add("Element2");
        arrayList.add("Element3");

        // 转换为流
        Stream<String> stream = arrayList.stream();

        // 打印流中的元素
        stream.forEach(System.out::println);
    }
}
